<?php

# http://projects:8081/cdapp-2kt-api/api/seat_runway_get.php

include_once '_portal.php';

$start_date = inpput('from') ?? date('Y-M-D');
$end_time   = inpput('from') ?? date('Y-M-D');

$start_time = $start_date . ' 00:00:00';
$end_time   = $end_date . ' 23:59:59';

$sql = "SELECT * FROM `2kt_runway_record` WHERE `startTime` <= '{$end_time}' AND `endTime` >= '{$start_time}'";

$result = exec_sql($sql);

$success = is_array($result);
$count   = $success ? count($result) : 0;
$data    = $success ? $result : [];

output([
  'status' => $success,
  'count'  => $count,
  'data'   => $data,
]);